<p-messages [(value)]="msg"></p-messages>
<div class="content-section implementation GridDemo" id="MalfunctionSolved" >
    <div class="title col-sm-12">
        <div class="col-sm-1">
            <span>解决故障单</span>
        </div>
        <div class="col-sm-11 pull-right">
            <button type="button"
                    class="pull-right"
                    pButton
                   (click)="goBack()"
                    icon="fa-close"
                    style="width: 30px"></button>
        </div>
    </div>
    <form [formGroup]="myForm" class="form-horizontal">
        <app-base-view></app-base-view>
        <div class="form-group">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>解决人组织：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <!--<div class="col-sm-6 ui-fluid ui-fluid-no-padding">-->
                    <input type="text" pInputText
                           readonly
                           [(ngModel)]="formObj.acceptor_org"
                           formControlName="solveOrgName"
                           class=" form-control cursor_not_allowed"
                    />
                    <!--<div class="ui-message ui-messages-error ui-corner-all" *ngIf="solveOrgName">-->
                        <!--<i class="fa fa-close"></i>-->
                        <!--不能为空-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="col-sm-3 ui-fluid-no-padding ui-padding-10px">-->
                    <!--<button  ngClass="ui-g-12 ui-fluid-no-padding"  pButton type="button" (click)="showTreeDialog('department')" label="选择"></button>-->
                <!--</div>-->
                <!--<div class="col-sm-3 ui-fluid-no-padding ui-padding-10px">-->
                    <!--<button  ngClass="ui-g-12 ui-fluid-no-padding"  pButton type="button" (click)="clearTreeDialog('department')" label="清空"></button>-->
                <!--</div>-->
            </div>
            <label class="col-sm-2 control-label">解决人：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <!--<p-dropdown [options]="options['departments']"-->
                            <!--[(ngModel)]="formObj.solve_per_name"-->
                            <!--optionLabel="name"-->
                            <!--(onChange)="onSelectedDepartment($event)"-->
                            <!--[ngModelOptions]="{standalone: true}"-->
                            <!--[style]="{'width':'100%'}"-->
                <!--&gt;</p-dropdown>-->
                <input type="text" pInputText
                       readonly
                       [(ngModel)]="formObj.acceptor"
                       [ngModelOptions]="{standalone: true}"
                       class=" form-control cursor_not_allowed"
                />
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>
                开始处理时间:
            </label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="text" pInputText  name="department" placeholder="自动生成"
                       [ngModelOptions]="{standalone: true}"
                       [(ngModel)]="formObj.process_time" readonly class="form-control cursor_not_allowed"/>
            </div>
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>
                完成处理时间:
            </label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <p-calendar [(ngModel)]="formObj.finish_time"
                            [showIcon]="true"
                            [locale]="zh"
                            name="end_time"
                            formControlName="finishTime"
                            dateFormat="yy-mm-dd"
                            [showTime]="true">
                </p-calendar>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="finishTime">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>
                故障原因：
            </label>
            <div class="col-sm-10 ui-no-padding-left-15px ">
                <input type="text" pInputText
                       class=" form-control"
                       formControlName="reason"
                       [(ngModel)]="formObj.reason"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="reason">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>
                解决方法：
            </label>
            <div class="col-sm-10 ui-no-padding-left-15px ">
                  <textarea [rows]="5" pInputTextarea autoResize="autoResize"
                            class="form-control"
                            formControlName="means"
                            [(ngModel)]="formObj.means"></textarea>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="means">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12 ui-no-padding-left-15px ui-no-padding-right-15px">
                <button class="pull-right  ui-button-secondary ui-margin-right-10px"  pButton type="button" (click)="goBack()" label="取消"></button>
                <button class="pull-right ui-margin-right-10px"  pButton type="button" (click)="solved()" label="解决"></button>
                <button class="pull-right ui-margin-right-10px"  pButton type="button" (click)="save()" label="保存"></button>
            </div>
        </div>
    </form>

    <p-dialog header="请选择" [(visible)]="display" modal="modal" width="300" [responsive]="true">
        <p-tree [value]="filesTree4"
                selectionMode="single"
                [(selection)]="selected"
                (onNodeExpand)="nodeExpand($event)"
        ></p-tree>
        <div style="margin-top:8px">Selected Node: {{selected ? selected.label : 'none'}}</div>
        <p-footer>
            <button type="button" pButton icon="fa-check" (click)="closeTreeDialog()" label="确定"></button>
            <button type="button" pButton icon="fa-close" (click)="display=false"
                    class="ui-button-secondary" label="取消"></button>
        </p-footer>
    </p-dialog>
    <p-growl [(value)]="message"></p-growl>
</div>
